/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.tech15.pub.dao;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.tech15.pub.model.*;
import com.tech15.pub.dao.*;
import com.tech15.pub.service.*;
import com.tech15.pub.vo.query.*;

/**
 * @author 胡作正 email:zuozhenghu@sina.com
 * @version 1.0
 * @since 1.0
 */


import static cn.org.rapid_framework.util.ObjectUtils.*;
import org.springframework.stereotype.Repository;

@Repository
public class PubXmjcbDao extends BaseHibernateDao<PubXmjcb,java.lang.String>{

	public Class getEntityClass() {
		return PubXmjcb.class;
	}
	
	public Page findByPageRequest(PageRequest<Map> pageRequest) {
		//XsqlBuilder syntax,please see http://code.google.com/p/rapid-xsqlbuilder
		// [column]为字符串拼接, {column}为使用占位符. 以下为图方便采用sql拼接,适用性能要求不高的应用,使用占位符方式可以优化性能. 
		// [column] 为PageRequest.getFilters()中的key
		String sql = "select t from PubXmjcb t where 1=1 "
				+ "/~ and t.sj = '[sj]' ~/"
				+ "/~ and t.xmmc = '[xmmc]' ~/"
				+ "/~ and t.htsl = '[htsl]' ~/"
				+ "/~ and t.jspz = '[jspz]' ~/"
				+ "/~ and t.jckw = '[jckw]' ~/"
				+ "/~ and t.dcjz = '[dcjz]' ~/"
				+ "/~ and t.jchaz = '[jchaz]' ~/"
				+ "/~ and t.hntxz = '[hntxz]' ~/"
				+ "/~ and t.zjjhxd = '[zjjhxd]' ~/"
				+ "/~ and t.zygjqd = '[zygjqd]' ~/"
				+ "/~ and t.ttwlqd = '[ttwlqd]' ~/"
				+ "/~ and t.bpbjyhp = '[bpbjyhp]' ~/"
				+ "/~ and t.pdg = '[pdg]' ~/"
				+ "/~ and t.jkg = '[jkg]' ~/"
				+ "/~ and t.yp = '[yp]' ~/"
				+ "/~ and t.zzsl = '[zzsl]' ~/"
				+ "/~ and t.bjsl = '[bjsl]' ~/"
				+ "/~ and t.rksl = '[rksl]' ~/"
				+ "/~ and t.ljrksl = '[ljrksl]' ~/"
				+ "/~ and t.byjhfh = '[byjhfh]' ~/"
				+ "/~ and t.bysfts = '[bysfts]' ~/"
				+ "/~ and t.ljfhts = '[ljfhts]' ~/"
				+ "/~ and t.bz = '[bz]' ~/"
				+ "/~ order by [sortColumns] ~/";
		return pageQuery(sql,pageRequest);
	}
	
	public Page findPage(PubXmjcbQuery query) {
        //XsqlBuilder syntax,please see http://code.google.com/p/rapid-xsqlbuilder
        // [column]为字符串拼接, {column}为使用占位符. [column]为使用字符串拼接,如username='[username]',偷懒时可以使用字符串拼接 
        // [column] 为PageRequest的属性
		String sql = "select t from PubXmjcb t where 1=1 "
			  	+ "/~ and t.sj = {sj} ~/"
			  	+ "/~ and t.xmmc like {xmmc} ~/"
			  	+ "/~ and t.htsl = {htsl} ~/"
			  	+ "/~ and t.jspz = {jspz} ~/"
			  	+ "/~ and t.jckw = {jckw} ~/"
			  	+ "/~ and t.dcjz = {dcjz} ~/"
			  	+ "/~ and t.jchaz = {jchaz} ~/"
			  	+ "/~ and t.hntxz = {hntxz} ~/"
			  	+ "/~ and t.zjjhxd = {zjjhxd} ~/"
			  	+ "/~ and t.zygjqd = {zygjqd} ~/"
			  	+ "/~ and t.ttwlqd = {ttwlqd} ~/"
			  	+ "/~ and t.bpbjyhp = {bpbjyhp} ~/"
			  	+ "/~ and t.pdg = {pdg} ~/"
			  	+ "/~ and t.jkg = {jkg} ~/"
			  	+ "/~ and t.yp = {yp} ~/"
			  	+ "/~ and t.zzsl = {zzsl} ~/"
			  	+ "/~ and t.bjsl = {bjsl} ~/"
			  	+ "/~ and t.rksl = {rksl} ~/"
			  	+ "/~ and t.ljrksl = {ljrksl} ~/"
			  	+ "/~ and t.byjhfh = {byjhfh} ~/"
			  	+ "/~ and t.bysfts = {bysfts} ~/"
			  	+ "/~ and t.ljfhts = {ljfhts} ~/"
			  	+ "/~ and t.bz = {bz} ~/"
				+ "/~ order by [sortColumns] ~/";
				
		return pageQuery(sql,query);
	}
	

}
